package com.linewell.commom.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.NotEmpty;

import com.linewell.system.model.SysCustomer;
import com.linewell.system.model.SysDepartment;
import com.linewell.system.model.SysRoles;
/**
 * 对应的数据库：SECOND_MARKET
 */
@Entity
@Table(name="SECOND_MARKET")
@DynamicInsert(true)
@DynamicUpdate(true)
public class SecondMarket implements Serializable{

	private static final long serialVersionUID = 5222354487623660586L;
	
	private Integer marketId;//编号
	private SysCustomer sysCustomer;//客户编号
	private SysDepartment sysDepartment;//部门编号
	private Byte flag;//类型
	private String title;//标题
	private String summary;//描述说明
	private String phone; //电话
	private String photo; // 图片
	private Double price;//价格
	private Byte status; //状态
	private Long createUserId;   //创建者
	private java.sql.Timestamp createTime;  //创建时间
	
	@Id
	@Column(name = "MARKET_ID",nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)		//自增长
	public Integer getMarketId() {
		return marketId;
	}

	public void setMarketId(Integer marketId) {
		this.marketId = marketId;
	}
	@ManyToOne(targetEntity = SysCustomer.class)
	@JoinColumn(name = "CUST_ID")
	public SysCustomer getSysCustomer() {
		return sysCustomer;
	}
	public void setSysCustomer(SysCustomer sysCustomer) {
		this.sysCustomer = sysCustomer;
	}
	@ManyToOne(targetEntity = SysDepartment.class)
	@JoinColumn(name = "DEP_ID")
	public SysDepartment getSysDepartment() {
		return sysDepartment;
	}
	
	public void setSysDepartment(SysDepartment sysDepartment) {
		this.sysDepartment = sysDepartment;
	}
	@Column(name = "phone")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "PHOTO")
	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	@Column(name = "FLAG")
	public Byte getFlag() {
		return flag;
	}
	public void setFlag(Byte flag) {
		this.flag = flag;
	}
	@Column(name = "TITLE")
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Column(name = "SUMMARY")
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	@Column(name = "STATUS",nullable = false,columnDefinition = "tinyint default 9")
	public Byte getStatus() {
		return status;
	}
	public void setStatus(Byte status) {
		this.status = status;
	}
	@Column(name = "CREATE_USER_ID")
	public Long getCreateUserId() {
		return createUserId;
	}
	public void setCreateUserId(Long createUserId) {
		this.createUserId = createUserId;
	}
	@Column(name = "CREATE_TIME" ,columnDefinition ="timestamp default CURRENT_TIMESTAMP")
	public java.sql.Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(java.sql.Timestamp createTime) {
		this.createTime = createTime;
	}
	
	@Column(name = "PRICE")
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
}
